package cn.bdqn.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.bdqn.entity.User;
import cn.bdqn.service.UserService;

@Controller
public class UserController {

	@Autowired
	private UserService userService;

	@RequestMapping("/user")
	public String getUser(Model model) {
		User user = userService.getUserById(1);
		model.addAttribute("user", user);
		return "index";
	}

	public static void main(String[] args) {
		System.err.println("嘿嘿嘿");
		System.err.println("嘿嘿嘿");
		System.err.println("嘿嘿嘿");
		System.err.println("嘿嘿嘿");
		System.err.println("嘿嘿嘿");

		System.out.println("呵呵呵");
		System.out.println("呵呵呵");
		System.out.println("呵呵呵");
		System.out.println("呵呵呵");
		System.out.println("呵呵呵");
		System.out.println("呵呵呵");
		
		System.out.println("哈哈");
		System.out.println("哈哈");
		System.out.println("哈哈");
		System.out.println("哈哈");
		System.out.println("哈哈");		
	}
}
